pub use binc_derive::*;

pub mod encode;
pub mod decode;

pub trait Encode {
    const ENCODE_MIN_LEN: usize;
    fn to_bytes(&self, buf: &mut [u8]) -> Option<usize>;
    unsafe fn to_bytes_unsafe(&self, buf: &mut [u8]) -> usize;
}

pub trait Decode<'de> {
    const DECODE_MIN_LEN: usize;
    fn from_bytes(buf: &'de [u8]) -> Option<Self>
    where
        Self: Sized;
}

